!#/bin/bash

sh ./install_utils.sh

sh ./install_libs.sh

#root user
adduser nicholasxu
mkdir /home/nicholasxu/backup
mkdir /home/nicholasxu/backup/db
mkdir /home/nicholasxu/backup/web
mkdir /home/nicholasxu/tools
chown -R nicholasxu:nicholasxu /home/nicholasxu

mkdir /home/wwwroot/download
ln -s /home/nicholasxu/backup  /home/wwwroot/download/backup
ln -s /home/nicholasxu/tools  /home/wwwroot/download/tools

echo "nicholasxu ALL=(ALL:AL) ALL" >> /etc/sudouser

cp -r /root/.ssh /home/nicholasxu
chown -R nicholasxu:nicholasxu /home/nicholasxu/.ssh
ln -s /home/wwwroot  /home/nicholasxu/html

useradd www
mkdir /home/wwwroot
chown -R /home/wwwroot
mkdir /home/wwwlogs
chown -R /home/wwwlogs

exit
